cmake_minimum_required(VERSION 3.8)
project(rm_calib_action)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake_auto REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(auto_aim_interfaces REQUIRED)
find_package(OpenCV REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(cv_bridge REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(calib_action_server src/calib_action_server.cpp)
ament_target_dependencies(
  calib_action_server
  "rclcpp"
  "rclcpp_action"
  "auto_aim_interfaces"
  "OpenCV"
  "std_msgs"
  "sensor_msgs"
  "cv_bridge"
)
target_link_libraries(calib_action_server ${OpenCV_LIBS})

add_executable(calib_action_client src/calib_action_client.cpp)
ament_target_dependencies(
  calib_action_client
  "rclcpp"
  "rclcpp_action"
  "auto_aim_interfaces"
)
target_link_libraries(calib_action_client ${OpenCV_LIBS})

install(TARGETS
  calib_action_server
  calib_action_client
  DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  set(ament_cmake_copyright_FOUND TRUE)
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
